<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAddressTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('address', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("user_id")->comment("用户ID");
            $table->string("username",50)->comment("用户名");
            $table->string("phone",20)->comment("电话");
            $table->string("province",50)->comment("省/直辖市");
            $table->string("city",50)->comment("市/地级市");
            $table->string("area",50)->comment("区/县");
            $table->string("detail",100)->comment("详细地址");
            $table->integer("selected")->default(0)->comment("默认地址");

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('address');
    }
}
